import { createApp } from 'vue'
import App from './App.vue'

// import router from './router/index.js'
// import router from './router/index'
import router from './router'
import store from './store'
import Vant from 'vant';
import VueLazyloadNext from 'vue-lazyload-next'
const loadimage = require('./assets/logo.png')
const errorimage = require('./assets/error.jpg')
// 引入组件样式
import 'vant/lib/index.css';
const app = createApp(App)
app.use(
    VueLazyloadNext,
    {
        preLoad: 1.3,
        error: errorimage,
        loading: loadimage,
        attempt: 1
    }
)
app.directive('focus', {
    /* ... */
    mounted: (el) => el.focus()
})
app.directive('preventclick', {
    beforeMount: (el) => {
        el.addEventListener('click', () => {
            el.disabled = true
            setTimeout(() => {
                el.disabled = false
            }, 2000);
        })
    }
})
app.use(Vant).use(store).use(router).mount('#app')